import { createRouter, createWebHashHistory } from "vue-router"; // 修改这里
import page from "./page";

const router = createRouter({
  history: createWebHashHistory(), // 修改这里，去掉BASE_URL参数
  routes: [
    {
      path: "/login",
      name: "login",
      component: () => import("../views/login/login.vue"),
    },
    // {
    //   path: "/register",
    //   name: "register",
    //   component: () => import("../views/login/register.vue"),
    // },
    {
      path: "/",
      redirect: "/website",
      component: () => import("@/layout/index.vue"),
      children: [...page],
    },
    {
      path: "/website",
      name: "website",
      component: () => import("@/views/website/index.vue"),
    },
    {
      path: "/studentSystem",
      name: "studentSystem",
      component: () => import("@/views/studentSystem/index.vue"),
    },
    {
      path: "/:pathMatch(.*)*",
      name: "notFound",
      component: () => import("@/views/error/404.vue"),
    }
  ],
});

export default router;
